import { sequelize } from "../db/sequelize.js"
import { DataTypes } from "sequelize"

//创建数据库用户模型并导出
export const Chapter = sequelize.define('chapters', {
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true
    },
    chapter: {
        type: DataTypes.STRING
    },
    teacher: {
        type: DataTypes.STRING
    },
    time: {
        type: DataTypes.STRING
    },
    member: {
        type: DataTypes.INTEGER
    },
    url: {
        type: DataTypes.STRING
    },
    courseId:{
        type:DataTypes.INTEGER
    }
})
//导出同步数据库方法
export const chaptersync = function () {
    sequelize.sync()
}